<?php

    header("Content-Type:text/html;charset=utf-8");

    if(isset($_POST['dosubmit'])) {
        // path 参数用来设置cookie保存的位置
        setCookie("isLogin", "1", time()+3600, "/");
        print_r($_COOKIE);
    }
 ?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>User Login</title>
    </head>
    <body>
        <form class="" action="" method="post">
            <label for="username">用户名：<input type="text" name="username" value=""></label>
            <label for="password">密码：<input type="text" name="password" value=""></label>
            <input type="submit" name="dosubmit" value="登入"></label>
        </form>
    </body>
</html>
